<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8" />
    
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
  <title>
    微信小程序《日常》 |  Yolin
  </title>
  <meta name="generator" content="hexo-theme-yilia-plus">
  
  <link rel="shortcut icon" href="/favicon.png" />
  
  
<link rel="stylesheet" href="/css/style.css">

  
<script src="/js/pace.min.js"></script>


  

  

<link rel="alternate" href="/atom.xml" title="Yolin" type="application/atom+xml">
<script src="/assets/js/DPlayer.min.js"></script></head>

</html>

<body>
  <div id="app">
    <main class="content">
      <section class="outer">
  <article id="post-微信小程序《日常》" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h1 class="article-title sea-center" style="border-left:0" itemprop="name">
  微信小程序《日常》
</h1>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2021/02/13/%E5%BE%AE%E4%BF%A1%E5%B0%8F%E7%A8%8B%E5%BA%8F%E3%80%8A%E6%97%A5%E5%B8%B8%E3%80%8B/" class="article-date">
  <time datetime="2021-02-13T10:45:02.000Z" itemprop="datePublished">2021-02-13</time>
</a>
      
  <div class="article-category">
    <a class="article-category-link" href="/categories/%E5%B0%8F%E7%A8%8B%E5%BA%8F/">小程序</a>
  </div>

      
      
<div class="word_count">
    <span class="post-time">
        <span class="post-meta-item-icon">
            <i class="ri-quill-pen-line"></i>
            <span class="post-meta-item-text"> 字数统计:</span>
            <span class="post-count">2.3k字</span>
        </span>
    </span>

    <span class="post-time">
        &nbsp; | &nbsp;
        <span class="post-meta-item-icon">
            <i class="ri-book-open-line"></i>
            <span class="post-meta-item-text"> 阅读时长≈</span>
            <span class="post-count">8分钟</span>
        </span>
    </span>
</div>

      
    </div>
    

    
    
    <div class="tocbot"></div>





    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h1 id="引言"><a href="#引言" class="headerlink" title="引言"></a>引言</h1><ol>
<li>优秀的人之所以优秀，是因为他们的生活已经规范化，他们养成了一个又一个好习惯，到了某个时间，习惯会推动他们做事，不需要靠意志力。正如小老鼠走迷宫的实验，经过上百次不断重复走迷宫的经历，老鼠的习惯回路就形成在大脑里面，大脑将其编入习惯系统里面，然后就可以刻意地记住应该怎么走。为了要构建某个习惯，我们必须刻意的去做这件事情，如果把它存在脑子里面就会增加负担，所以必须把它可视化，这样就比较容易能够记得住，比较容易能够标准化的去进行刻意练习 。       </li>
</ol>
<ol start="2">
<li>我们大部分的拖延、迷茫、焦虑都是因为没有目标引起的。因为没有目标，做事没有方向感，注意力不集中，很容易被其他事情吸引，比如计划好学习，抖音却刷的停不下来。目标要定制的合理，可以是预期的，潜意识里对目标产生渴望，驱动你去努力实现它。</li>
</ol>
<p><strong>本小程序专注于用户的习惯培养，帮助用户构建习惯，懂得时间管理，合理利用零碎时间，培养兴趣，为生活创造价值。</strong></p>
<div id="dplayer0" class="dplayer hexo-tag-dplayer-mark" style="margin-bottom: 20px;"></div><script>(function(){var player = new DPlayer({"container":document.getElementById("dplayer0"),"theme":"#FADFA3","video":{"url":"https://yolin-1300189713.cos.ap-beijing.myqcloud.com/bandicam%202020-06-11%2021-24-18-089.mp4","pic":"https://moeplayer.b0.upaiyun.com/dplayer/hikarunara.jpg"},"danmaku":{"id":"9E2E3368B56CDBB4","api":"https://api.prprpr.me/dplayer/","token":"tokendemo"}});window.dplayers||(window.dplayers=[]);window.dplayers.push(player);})()</script>

<p>开源地址：</p>
<p><a href="https://gitee.com/yolin121/daily" target="_blank" rel="noopener">https://gitee.com/yolin121/daily</a></p>
<a id="more"></a>
<h1 id="一、应用场景"><a href="#一、应用场景" class="headerlink" title="一、应用场景"></a>一、应用场景</h1><p>​          微信已经深入普及在我们的生活中，加上小程序自身所存在的特性及优势，简单、实用、易上手<br>的工具往往能很好的培养用户粘性，特别是在微信这个庞大的流量池中。</p>
<p>​          此小程序主要面向学生，不同学习阶段的学生有不同量的学习任务，每天都要处理不同的事物，<br>好的时间管理能提高学习生活效率。很多学生在结束一天的学习内容后，会获得零碎的时间，而多数人<br>总是以休息、游戏、刷剧的方式去打发时间，这种沉浸式的生活方式会让人迷茫，有时会产生没事做的<br>感觉。对于这种零碎时间最好的处理方式应该是去做当下最需要做的事，或解燃眉之急，亦或了多时之<br>愿，当那些棘手的或是欣欣念念的事被完成时，获得的满足感足以让我们沉浸在幸福之中，这绝对比简<br>单的休息更为美妙。当然需要明确的是，任何时候的时间充足率、效能的提升都不能以牺牲健康为前<br>提。</p>
<h1 id="二、解决的实际问题"><a href="#二、解决的实际问题" class="headerlink" title="二、解决的实际问题"></a>二、解决的实际问题</h1><p>​     1、帮助用户构建、培养日常习惯，充实生活</p>
<p>​     2、待做清单，解放大脑，高效生活</p>
<p>​     3、合理利用时间，拒绝拖延症</p>
<p>​     4、培养兴趣爱好，改善生活方式</p>
<h1 id="三、技术开发方案"><a href="#三、技术开发方案" class="headerlink" title="三、技术开发方案"></a>三、技术开发方案</h1><h2 id="技术支撑"><a href="#技术支撑" class="headerlink" title="技术支撑"></a>技术支撑</h2><ol>
<li>界面采用ColorUI组件库</li>
<li>语音识别调用微信同声传译API</li>
<li>日历使用极点日历插件</li>
<li>echarts将数据可视化</li>
<li>nodejs作服务端支持</li>
<li>使用微信云开发</li>
</ol>
<h2 id="获取用户openid"><a href="#获取用户openid" class="headerlink" title="获取用户openid"></a>获取用户openid</h2><ol>
<li>wx.login()<ol>
<li>调用接口获取登录凭证，获取用户登录状态信息，包括openid和session_key。</li>
<li>session_key是对用户数据进行加密签名的密钥 </li>
</ol>
</li>
<li>调用getSetting()获取用户信息，判断是否授权登录，若已授权可以直接调用getUserInfo获取用户信息,其中是通过调用云函数login获取openid 的。</li>
</ol>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">// 获取用户信息</span></span><br><span class="line">    wx.getSetting(&#123;</span><br><span class="line">      success: <span class="function"><span class="params">res</span> =&gt;</span> &#123;</span><br><span class="line">        <span class="keyword">if</span> (res.authSetting[<span class="string">'scope.userInfo'</span>]) &#123;</span><br><span class="line">          <span class="comment">// 已经授权，可以直接调用 getUserInfo 获取头像昵称，不会弹框</span></span><br><span class="line">          <span class="built_in">console</span>.log(<span class="string">"已经授权"</span>)</span><br><span class="line">          wx.getUserInfo(&#123;</span><br><span class="line">            success: <span class="function"><span class="params">res</span> =&gt;</span> &#123;</span><br><span class="line">              <span class="comment">// 可以将 res 发送给后台解码出 unionId</span></span><br><span class="line">              <span class="keyword">this</span>.globalData.userInfo = res.userInfo</span><br><span class="line">              <span class="comment">// 由于 getUserInfo 是网络请求，可能会在 Page.onLoad 之后才返回</span></span><br><span class="line">              <span class="comment">// 所以此处加入 callback 以防止这种情况</span></span><br><span class="line">              <span class="keyword">if</span> (<span class="keyword">this</span>.userInfoReadyCallback) &#123;</span><br><span class="line">                <span class="keyword">this</span>.userInfoReadyCallback(res)</span><br><span class="line">              &#125;</span><br><span class="line">              <span class="built_in">console</span>.log(res)</span><br><span class="line">                   <span class="comment">//云函数获取用户openid</span></span><br><span class="line">            wx.cloud.callFunction(&#123;</span><br><span class="line">              name:<span class="string">'login'</span>,</span><br><span class="line">              success:<span class="function"><span class="params">res</span>=&gt;</span>&#123;</span><br><span class="line">               <span class="keyword">this</span>.globalData.userOpenid=res.result.openid</span><br><span class="line">              &#125;</span><br><span class="line">            &#125;)</span><br><span class="line">            &#125;</span><br><span class="line">          &#125;)</span><br><span class="line">        &#125;<span class="keyword">else</span>&#123;</span><br><span class="line">          <span class="built_in">console</span>.log(<span class="string">"未授权"</span>)</span><br><span class="line">          <span class="keyword">this</span>.globalData.not_login=<span class="literal">true</span></span><br><span class="line">        &#125;</span><br><span class="line">      &#125;</span><br><span class="line">    &#125;)</span><br><span class="line">  &#125;</span><br></pre></td></tr></table></figure>

<h2 id="文件上传"><a href="#文件上传" class="headerlink" title="文件上传"></a>文件上传</h2><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br></pre></td><td class="code"><pre><span class="line">upimg()&#123;</span><br><span class="line">    <span class="keyword">this</span>.suijishu()</span><br><span class="line">    <span class="comment">//弹出选择图片对话框</span></span><br><span class="line">    wx.chooseImage(&#123;</span><br><span class="line">      complete: <span class="function">(<span class="params">res</span>) =&gt;</span> &#123;</span><br><span class="line">        <span class="built_in">console</span>.log(res)</span><br><span class="line">        <span class="keyword">let</span> path=res.tempFilePaths[<span class="number">0</span>]</span><br><span class="line">       wx.showToast(&#123;</span><br><span class="line">         title: <span class="string">'图片上传中'</span>,</span><br><span class="line">         icon:<span class="string">'loading'</span>,</span><br><span class="line">         duration:<span class="number">4000</span>,</span><br><span class="line">         mask:<span class="literal">true</span></span><br><span class="line">       &#125;)</span><br><span class="line">        <span class="comment">//云存储调用-上传文件方法</span></span><br><span class="line">        wx.cloud.uploadFile(&#123;</span><br><span class="line">          cloudPath:<span class="string">"richang/"</span>+<span class="keyword">this</span>.data.suiji+<span class="string">".png"</span>,</span><br><span class="line">          filePath:path,</span><br><span class="line">          success:<span class="function">(<span class="params">res</span>)=&gt;</span>&#123;</span><br><span class="line">            <span class="built_in">console</span>.log(<span class="string">"图片上传成功"</span>,res)</span><br><span class="line">            wx.showToast(&#123;</span><br><span class="line">              title: <span class="string">'图片上传成功'</span>,</span><br><span class="line">            &#125;)</span><br><span class="line">            <span class="keyword">this</span>.setData(&#123;</span><br><span class="line">              backgroundimg:res.fileID</span><br><span class="line">            &#125;)</span><br><span class="line">            wx.setStorage(&#123;</span><br><span class="line">              key:<span class="string">'me'</span>,</span><br><span class="line">              data:<span class="keyword">this</span>.data.backgroundimg,</span><br><span class="line">              success(e)&#123;&#125;</span><br><span class="line">            &#125;)</span><br><span class="line">          &#125;,</span><br><span class="line">          fail:<span class="function">(<span class="params">res</span>)=&gt;</span>&#123;</span><br><span class="line">            <span class="built_in">console</span>.log(<span class="string">"上传失败"</span>,res)</span><br><span class="line">  </span><br><span class="line">          &#125;</span><br><span class="line">        &#125;)</span><br><span class="line">  </span><br><span class="line">      &#125;,  </span><br><span class="line">    &#125;)</span><br><span class="line">  &#125;,</span><br></pre></td></tr></table></figure>

<h2 id="倒计时操作"><a href="#倒计时操作" class="headerlink" title="倒计时操作"></a>倒计时操作</h2><p>思想：记录开始时间，开始的时间戳加上需要的时间作为结束的时间，每秒调用一下记时方法，进行格式转换，显示到页面上，最后判断当前时间是否到截止时间</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//倒计时</span></span><br><span class="line">  countDown() &#123;</span><br><span class="line">    <span class="keyword">var</span> that = <span class="keyword">this</span></span><br><span class="line">    <span class="keyword">var</span> starttime = <span class="keyword">this</span>.data.now</span><br><span class="line">     <span class="built_in">console</span>.log(starttime)</span><br><span class="line">    <span class="keyword">var</span> start = <span class="keyword">new</span> <span class="built_in">Date</span>(starttime).getTime()</span><br><span class="line">     <span class="built_in">console</span>.log(start)</span><br><span class="line">    <span class="keyword">var</span> endTime = start + <span class="keyword">this</span>.data.timeindex * <span class="number">60000</span><span class="comment">//开始的时间戳加上需要的时间作为结束的时间</span></span><br><span class="line">     <span class="keyword">var</span> now = <span class="keyword">new</span> <span class="built_in">Date</span>().getTime(); <span class="comment">//现在时间戳</span></span><br><span class="line">    <span class="keyword">var</span> allTime = endTime - now<span class="comment">//</span></span><br><span class="line">    <span class="keyword">var</span> m, s;</span><br><span class="line">    <span class="keyword">if</span> (allTime &gt; <span class="number">0</span>) &#123;</span><br><span class="line">      m = <span class="built_in">Math</span>.floor(allTime / <span class="number">1000</span> / <span class="number">60</span> % <span class="number">60</span>);</span><br><span class="line">      s = <span class="built_in">Math</span>.floor(allTime / <span class="number">1000</span> % <span class="number">60</span>);</span><br><span class="line">      s = s&lt;<span class="number">10</span>?<span class="string">"0"</span>+s:s</span><br><span class="line">      m = m&lt;<span class="number">10</span>?<span class="string">"0"</span>+m:m</span><br><span class="line">      that.setData(&#123;</span><br><span class="line">        countdown: m + <span class="string">":"</span> + s,</span><br><span class="line">      &#125;)</span><br><span class="line">      setTimeout(that.countDown, <span class="number">1000</span>);</span><br><span class="line">    &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">      <span class="built_in">console</span>.log(<span class="string">'已截止'</span>)</span><br><span class="line">      audio.stop()</span><br><span class="line">      that.setData(&#123;</span><br><span class="line">        countdown: <span class="string">'00:00'</span>,</span><br><span class="line">        modalName:<span class="string">"Image"</span>,</span><br><span class="line">        finishZhuanZhu:<span class="literal">true</span></span><br><span class="line">      &#125;)</span><br><span class="line">      </span><br><span class="line">    &#125;</span><br><span class="line">  &#125;,</span><br></pre></td></tr></table></figure>
<h1 id="四、主要内容介绍"><a href="#四、主要内容介绍" class="headerlink" title="四、主要内容介绍"></a>四、主要内容介绍</h1><h2 id="1-日常模块"><a href="#1-日常模块" class="headerlink" title="1. 日常模块"></a>1. 日常模块</h2><p>该页面是有关于培养习惯的。构建习惯的过程，就像我们去一个陌生的地方旅行一样，我们对这<br>个习惯可能很陌生，正因为陌生所以我们才需要构建它，我们提供了诸多公认的好习惯可帮用户直接选<br>择，简要阐述了该习惯的价值所在。当然用户也可以自定义习惯内容。页面上方的日历记录习惯的打卡<br>日期和天数。数据统计中包含更详细的打卡数据，另外用扇形图将数据展示出来，更直观反映出用户的<br>行为。用户可根据自己选择打卡方式：</p>
<ol>
<li>按钮打卡</li>
<li>番茄打卡</li>
</ol>
<p>这里推荐番茄打卡，让用户能提高专<br>注力，避免手机的干扰。同时我们将习惯划分为4个阶段：</p>
<ul>
<li>全力爆发期</li>
<li>意志疲软期</li>
<li>懈怠麻木期</li>
<li>平稳期</li>
</ul>
<p>根据用户打卡天数给予反馈，给用户相应的提示，因为构建习惯的过程是艰难的，只有到了最后<br>的平稳期，用户才会不需要意志力推动他们做事，因为这已经成为了习惯，成为了”<strong>日常</strong>“。</p>
<h3 id="页面展示"><a href="#页面展示" class="headerlink" title="页面展示"></a>页面展示</h3><p>​            1、首次进入页面习惯数据为空，用户可点击右下角按钮进入习惯分类页面</p>
<p><img src="https://yolin121.oss-cn-beijing.aliyuncs.com/blogimg/image-20200611221414687.png" alt=""></p>
<p>​            2、用户根据需要选择要培养的习惯类别，也可以自定义习惯</p>
<p><img src="https://yolin121.oss-cn-beijing.aliyuncs.com/blogimg/image-20200611222239383.png" alt=""></p>
<p>​            3、点击任意一个习惯，将跳转至添加习惯页面，内置的习惯会有个此习惯的好处，以及收获</p>
<p>，提高用户兴趣</p>
<p><img src="https://yolin121.oss-cn-beijing.aliyuncs.com/blogimg/image-20200611222144143.png" alt=""></p>
<p>​            4、填写习惯内容，选择图标颜色，并设置要执行的时段，最后点击添加到习惯列表</p>
<p><img src="https://yolin121.oss-cn-beijing.aliyuncs.com/blogimg/image-20200611222555367.png" alt=""></p>
<p>​            5、点击添加的习惯，会弹出当前该习惯的信息，该内容展示由打卡天数决定，用户可选择直接</p>
<p>打卡，也可以选择番茄打卡</p>
<p><img src="https://yolin121.oss-cn-beijing.aliyuncs.com/blogimg/image-20200611222419679.png" alt=""></p>
<p>​            6、点击图片上方的按钮即可进入番茄打卡页面，该页面下用户可选择专注时间，以及页面背景</p>
<p>色与是否打开音乐</p>
<p><img src="https://yolin121.oss-cn-beijing.aliyuncs.com/blogimg/image-20200611222717158.png" alt=""></p>
<p>​            7、点击开始专注，时间会进行倒计时，此时用户不可操作手机否则任务失败，用户可选择放<br>弃。当时间归零后即提示用户完成打卡</p>
<p>​            8、打卡后数据自动更新，日历和数据统计部分也会调整，并提交到数据库</p>
<p>​            9、通过菜单栏进入数据统计部分，这里将对用户的习惯数据作以统计，展示方式包括卡片以及<br>echarts将数据可视化，用户可直观的看到自己的信息</p>
<p><img src="https://yolin121.oss-cn-beijing.aliyuncs.com/blogimg/image-20200611222309659.png" alt=""></p>
<p>​            10、长按习惯可删除</p>
<h2 id="2-待做模块"><a href="#2-待做模块" class="headerlink" title="2. 待做模块"></a>2. 待做模块</h2><p>​            辅助日常的使用，将习惯细致化，将日常工作列出来，使任务项目可视化，避免遗漏，让生活更</p>
<p>从容有序，帮你从冗杂的待办事项中解脱。使用与传统的todolist没有太大差别，简单易操作，支持键盘和语音输入（同声传译）</p>
<p><img src="https://yolin121.oss-cn-beijing.aliyuncs.com/blogimg/image-20200611222904957.png" alt=""></p>
<h2 id="3-点滴模块"><a href="#3-点滴模块" class="headerlink" title="3. 点滴模块"></a>3. 点滴模块</h2><p>​            记录成长，记录心情，感觉延续的变化。</p>
<p>​            内容用户随意编写，可以记录自己坚持的变化、设置长期计划、备忘录等，另外可以给文字配上<br>图片，使得内容充实有趣。</p>
<p><img src="https://yolin121.oss-cn-beijing.aliyuncs.com/blogimg/image-20200611222934673.png" alt=""></p>

      
      <!-- reward -->
      
    </div>
      <!-- copyright -->
      
    <footer class="article-footer">
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E5%BE%AE%E4%BF%A1%E5%B0%8F%E7%A8%8B%E5%BA%8F/" rel="tag">微信小程序</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E9%A1%B9%E7%9B%AE/" rel="tag">项目</a></li></ul>


    </footer>

  </div>

  
  
  <nav class="article-nav">
    
      <a href="/2021/02/15/%E5%B8%B8%E8%A7%81%E7%AE%97%E6%B3%95%E6%80%BB%E7%BB%93/" class="article-nav-link">
        <strong class="article-nav-caption">上一篇</strong>
        <div class="article-nav-title">
          
            常见算法总结
          
        </div>
      </a>
    
    
      <a href="/2021/02/10/MyBatis%E6%A0%B8%E5%BF%83%E7%9F%A5%E8%AF%86%E6%95%B4%E7%90%86/" class="article-nav-link">
        <strong class="article-nav-caption">下一篇</strong>
        <div class="article-nav-title">Mybatis核心知识整理</div>
      </a>
    
  </nav>


  

  
  
<!-- valine评论 -->
<div id="vcomments-box">
    <div id="vcomments">
    </div>
</div>
<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<script src='https://cdn.jsdelivr.net/npm/valine@1.3.10/dist/Valine.min.js'></script>
<script>
    new Valine({
        el: '#vcomments',
        notify: false,
        verify: '',
        app_id: '',
        app_key: '',
        path: window.location.pathname,
        avatar: 'mp',
        placeholder: '给我的文章加点评论吧~',
        recordIP: true
    });
    const infoEle = document.querySelector('#vcomments .info');
    if (infoEle && infoEle.childNodes && infoEle.childNodes.length > 0) {
        infoEle.childNodes.forEach(function (item) {
            item.parentNode.removeChild(item);
        });
    }
</script>
<style>
    #vcomments-box {
        padding: 5px 30px;
    }

    @media screen and (max-width: 800px) {
        #vcomments-box {
            padding: 5px 0px;
        }
    }

    #vcomments-box #vcomments {
        background-color: #fff;
    }

    .v .vlist .vcard .vh {
        padding-right: 20px;
    }

    .v .vlist .vcard {
        padding-left: 10px;
    }
</style>

  

  
  
  

</article>
</section>
      <footer class="footer">
  <div class="outer">
    <ul class="list-inline">
      <li>
        &copy;
        2020-2021
        张金
      </li>
      <li>
        
      </li>
    </ul>
    <ul class="list-inline">
      <li>
        
        
        <span>
  <i>PV:<span id="busuanzi_value_page_pv"></span></i>
  <i>UV:<span id="busuanzi_value_site_uv"></span></i>
</span>
        
      </li>
      <li>
        <!-- cnzz统计 -->
        
        <script type="text/javascript" src='https://s9.cnzz.com/z_stat.php?id=1278069914&amp;web_id=1278069914'></script>
        
        <img src="https://yolin121.oss-cn-beijing.aliyuncs.com/blogimg/beian.png">
        <a href="https://beian.miit.gov.cn"  style="color:#f72b07" target="_blank">陕ICP备20002449号</a>
      </li>

    </ul>
  </div>
</footer>
    <div class="to_top">
        <div class="totop" id="totop">
  <i class="ri-arrow-up-line"></i>
</div>
      </div>
    </main>
      <aside class="sidebar">
        <button class="navbar-toggle"></button>
<nav class="navbar">
  
  <div class="logo">
    <a href="/"><img src="/images/ayer-side.svg" alt="Yolin"></a>
  </div>
  
  <ul class="nav nav-main">
    
    <li class="nav-item">
      <a class="nav-item-link" href="/">主页</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/archives">归档</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/categories">分类</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags">标签</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/playlist">歌单</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/video">视频</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/about">关于我</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/friends">友情链接</a>
    </li>
    
  </ul>
</nav>
<nav class="navbar navbar-bottom">
  <ul class="nav">
    <li class="nav-item">
      
      <a class="nav-item-link nav-item-search"  title="Search">
        <i class="ri-search-line"></i>
      </a>
      
      
      <a class="nav-item-link" target="_blank" href="/atom.xml" title="RSS Feed">
        <i class="ri-rss-line"></i>
      </a>
      
    </li>
  </ul>
</nav>
<div class="search-form-wrap">
  <div class="local-search local-search-plugin">
  <input type="search" id="local-search-input" class="local-search-input" placeholder="Search...">
  <div id="local-search-result" class="local-search-result"></div>
</div>
</div>
      </aside>
      <div id="mask"></div>

<!-- #reward -->
<div id="reward">
  <span class="close"><i class="ri-close-line"></i></span>
  <p class="reward-p"><i class="ri-cup-line"></i>请我喝杯咖啡吧~</p>
  <div class="reward-box">
    
    <div class="reward-item">
      <img class="reward-img" src="/images/alipay.jpg">
      <span class="reward-type">支付宝</span>
    </div>
    
    
    <div class="reward-item">
      <img class="reward-img" src="/images/wechat.jpg">
      <span class="reward-type">微信</span>
    </div>
    
  </div>
</div>
      
<script src="/js/jquery-2.0.3.min.js"></script>


<script src="/js/jquery.justifiedGallery.min.js"></script>


<script src="/js/lazyload.min.js"></script>


<script src="/js/busuanzi-2.3.pure.min.js"></script>


<script src="/js/share.js"></script>




<script>
  try {
    var typed = new Typed("#subtitle", {
    strings: ['肠断月明红豆蔻,','月似当时,','人似当时否？'],
    startDelay: 1500,
    typeSpeed: 200,
    loop: true,
    backSpeed: 40,
    showCursor: true
    });
  } catch (err) {
  }
  
</script>




<script src="/js/tocbot.min.js"></script>

<script>
  // Tocbot_v4.7.0  http://tscanlin.github.io/tocbot/
  tocbot.init({
    tocSelector: '.tocbot',
    contentSelector: '.article-entry',
    headingSelector: 'h1, h2, h3, h4, h5, h6',
    hasInnerContainers: true,
    scrollSmooth: true,
    scrollContainer:'main',
    positionFixedSelector: '.tocbot',
    positionFixedClass: 'is-position-fixed',
    fixedSidebarOffset: 'auto',
    onClick: (e) => {
      $('.toc-link').removeClass('is-active-link');
      $(`a[href=${e.target.hash}]`).addClass('is-active-link');
      $(e.target.hash).scrollIntoView();
      return false;
    }
  });
</script>


<script>
  var ayerConfig = {
    mathjax: true
  }
</script>


<script src="/js/ayer.js"></script>


<script src="https://cdn.jsdelivr.net/npm/jquery-modal@0.9.2/jquery.modal.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jquery-modal@0.9.2/jquery.modal.min.css">


<!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">

    <!-- Background of PhotoSwipe. 
         It's a separate element as animating opacity is faster than rgba(). -->
    <div class="pswp__bg"></div>

    <!-- Slides wrapper with overflow:hidden. -->
    <div class="pswp__scroll-wrap">

        <!-- Container that holds slides. 
            PhotoSwipe keeps only 3 of them in the DOM to save memory.
            Don't modify these 3 pswp__item elements, data is added later on. -->
        <div class="pswp__container">
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
        </div>

        <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
        <div class="pswp__ui pswp__ui--hidden">

            <div class="pswp__top-bar">

                <!--  Controls are self-explanatory. Order can be changed. -->

                <div class="pswp__counter"></div>

                <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>

                <button class="pswp__button pswp__button--share" style="display:none" title="Share"></button>

                <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>

                <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>

                <!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
                <!-- element will get class pswp__preloader--active when preloader is running -->
                <div class="pswp__preloader">
                    <div class="pswp__preloader__icn">
                        <div class="pswp__preloader__cut">
                            <div class="pswp__preloader__donut"></div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
                <div class="pswp__share-tooltip"></div>
            </div>

            <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
            </button>

            <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
            </button>

            <div class="pswp__caption">
                <div class="pswp__caption__center"></div>
            </div>

        </div>

    </div>

</div>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/default-skin/default-skin.css">
<script src="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe-ui-default.min.js"></script>

<script>
    function viewer_init() {
        let pswpElement = document.querySelectorAll('.pswp')[0];
        let $imgArr = document.querySelectorAll(('.article-entry img:not(.reward-img)'))

        $imgArr.forEach(($em, i) => {
            $em.onclick = () => {
                // slider展开状态
                // todo: 这样不好，后面改成状态
                if (document.querySelector('.left-col.show')) return
                let items = []
                $imgArr.forEach(($em2, i2) => {
                    let img = $em2.getAttribute('data-idx', i2)
                    let src = $em2.getAttribute('data-target') || $em2.getAttribute('src')
                    let title = $em2.getAttribute('alt')
                    // 获得原图尺寸
                    const image = new Image()
                    image.src = src
                    items.push({
                        src: src,
                        w: image.width || $em2.width,
                        h: image.height || $em2.height,
                        title: title
                    })
                })
                var gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, {
                    index: parseInt(i)
                });
                gallery.init()
            }
        })
    }
    viewer_init()
</script>



<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
      tex2jax: {
          inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
          processEscapes: true,
          skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
      }
  });

  MathJax.Hub.Queue(function() {
      var all = MathJax.Hub.getAllJax(), i;
      for(i=0; i < all.length; i += 1) {
          all[i].SourceElement().parentNode.className += ' has-jax';
      }
  });
</script>

<script src="https://cdn.jsdelivr.net/npm/mathjax@2.7.6/unpacked/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>


<script type="text/javascript" src="https://js.users.51.la/20544303.js"></script>
  </div>
</body>

</html>